// import '@babel/polyfill'//webpack4 中设置了"useBuiltIns": "usage",就不需要引了
import './assets/icomoon/style.css'
import './index.scss'
import stylesc from './avatar.scss'
import avtar from './avtar.png'
import createImg from './createImg'
import { addNum } from '@/utils/util.js'
// import _ from 'lodash'
import $ from 'jquery'
import { caozuo } from './dianpian.js'
caozuo()
console.log(stylesc);
var imgObj = new Image()
imgObj.src = avtar
imgObj.dataset.aaa = '45ffyyffc'
imgObj.classList.add(stylesc.avatar)
imgObj.classList.add('avatar')
document.getElementById('app').appendChild(imgObj)
createImg()

let btn = document.createElement('button')
btn.innerHTML = '增加'
document.getElementById('app').appendChild(btn)
btn.onclick = function () {
  var h2 = document.createElement('h2')
  h2.innerHTML = 'itembmmp'
  document.getElementById('app').appendChild(h2)
}

const arr = [
  new Promise(() => {}),
  new Promise(() => {})
]

arr.map((item) => {
  console.log(item);
})
console.log(addNum(6, 44));
// console.log(_.join([123, 456], '**********'));
function getTT () {
  return import(/* webpackChunkName: "lodashcuk" */ 'lodash').then((options) => {
    return options.default.join([123, 345], '=======')
  })
}
// getTT().then((res) => {
//   console.log(res);
// })
$('body').css({
  backgroundColor: 'pink'
})

btn.addEventListener('click', function () {
  getTT().then((res) => {
    console.log(res);
  })
})

let btn2 = document.createElement('button')
btn2.innerHTML = '测试代码覆盖率dd'
document.getElementById('app').appendChild(btn2)

btn2.addEventListener('click', function () {
  import(/* webpackPrefetch: true, webpackChunkName: "clickfn" */ './click.js').then(({default: func}) => {
    func()
  })
})
console.log(this);